
	<!-- footer -->
	<div id="footer">
		<h1>get in touch</h1>
			<h3 class="center follow">
				We're social and we'd love to hear from you! Feel free to send us an email, find us on Google Plus, follow us on Twitter and join us on Facebook.
			</h3>
	<div class="follow_us">
		<a href="#" class="fa fa-twitter follow_us"></a>
		<a href="#" class="fa fa-facebook follow_us"></a>
		<a href="#" class="fa fa-linkedin follow_us"></a>
		<a href="#" class="fa fa-google-plus follow_us"></a>
		<a href="#" class="fa fa-vimeo-square follow_us"></a>
		</div>
	</div>
	
	<!-- footer 2 -->
	<div id="footer2">
		<div class="container">
			<div class="row">
				<div class="col-md-12">
				<div class="copyright">
							Jönkötrade PHP Project
							&copy;
							<script type="text/javascript">
							//<![CDATA[
								var d = new Date()
								document.write(d.getFullYear())
								//]]>
								</script>
							 - All Rights Reserved :
							Template by <a href="http://spiralpixel.com">Spiral Pixel</a> - 
						</div>
						</div>
					</div>
				</div>
					</div>
				<!-- up to top -->
				<a href="#"><i class="go-top fa fa-angle-double-up"></i></a>
				<!--//end-->
				
<!-- SCRIPTS -->
<script src="js/jquery.js"></script>			
<script src="js/bootstrap.min.js"></script>	

<script src="js/jquery.touchSwipe.min.js"></script>
<script src="js/jquery.mousewheel.min.js"></script>				
<script type="text/javascript" src="js/jquery.prettyPhoto.js"></script>
<script type="text/javascript" src="js/scripts.js"></script>
<script type="text/javascript" src="js/jquery.carouFredSel-6.2.1-packed.js"></script>
<script src="js/jquery.nivo.slider.pack.js"></script>
<script src="js/retina.js"></script>
<script src="//tinymce.cachefly.net/4.1/tinymce.min.js"></script>
<script type="text/javascript" src="js/jquery.cropbox.js"></script>
<script src="js/imagesloaded.pkgd.min.js"></script>
<script src="js/masonry.pkgd.min.js"></script>
<script src="js/classie.js"></script>
<script src="js/jquery.isotope.min.js" type="text/javascript"></script>
<script src="js/modernizr.custom.js"></script>
<script src="js/cbpGridGallery.js"></script>
<script>
//<![CDATA[
	new CBPGridGallery( document.getElementById( 'grid-gallery' ) );
//]]>
</script>

<!-- SLIDER REVOLUTION 4.x SCRIPTS  -->
<script type="text/javascript" src="rs-plugin/js/jquery.themepunch.tools.min.js"></script>   
<script type="text/javascript" src="rs-plugin/js/jquery.themepunch.revolution.min.js"></script>


<!-- //////////////// SCRIPTS MAISON \\\\\\\\\\\\\\\\\ -->

<script type="text/javascript"> // Petits scripts maison

<?php if(isset($sell_yours))
{ ?>
	var mapBox = document.getElementById('pr_area');

	mapBox.onkeyup = function(){
		document.getElementById('map').innerHTML = '<iframe width="100%" height="100%" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?key=AIzaSyB0qujj1vZpFojRIwf3BefNyIYZq5FBhE8&q='+mapBox.value+'+Jonkoping"></iframe>'
	}	

	var nameBox = document.getElementById('pr_name');

	nameBox.onkeyup = function(){
		document.getElementById('name').innerHTML = nameBox.value
	}		
		
	var descBox = document.getElementById('pr_shortdesc');

	descBox.onkeyup = function(){
		document.getElementById('desc').innerHTML = descBox.value
	} <?php
} ?> 
<!-- End of sell_yours  -->


<!-- show_product  -->
<!-- End of show_product  -->

<!-- browse_products  -->
<?php if(isset($browse_products))
{ 
	if ($browse_products)
	{?>
		var cat = document.getElementById("cat<?php if(isset($cat)) echo $cat; ?>");
		
		if(cat.getAttribute("class") != "selected") 
		{
			cat.setAttribute("class", "selected");
		} <?php
	}
} ?> 
<!-- End of browse_products  -->

//]]>
</script>

<script type="text/javascript"> 

$(document).ready(function (e) {
$("#uploadimage").on('submit',(function(e) {
e.preventDefault();
$("#message").empty();
$('#loading').show();
$.ajax({
url: "inc/ajax_upload.php", // Url to which the request is send
type: "POST",             // Type of request to be send, called as method
data: new FormData(this), // Data sent to server, a set of key/value pairs (i.e. form fields and values)
contentType: false,       // The content type used when sending data to the server.
cache: false,             // To unable request pages to be cached
processData:false,        // To send DOMDocument or non processed data file it is set to false
success: function(data)   // A function to be called if request succeeds
{
$('#loading').hide();
$("#message").html(data);
}
});
}));

// Function to preview image after validation
$(function() {
$("#pr_addpic").change(function() {
$("#message").empty(); // To remove the previous error message
var file = this.files[0];
var imagefile = file.type;
var match= ["image/jpeg","image/png","image/jpg"];
if(!((imagefile==match[0]) || (imagefile==match[1]) || (imagefile==match[2])))
{
$('#previewing').attr('src','noimage.png');
$("#message").html("<p id='error'>Please Select A valid Image File</p>"+"<h4>Note</h4>"+"<span id='error_message'>Only jpeg, jpg and png Images type allowed</span>");
return false;
}
else
{
var reader = new FileReader();
reader.onload = imageIsLoaded;
reader.readAsDataURL(this.files[0]);
}
});
});
function imageIsLoaded(e) {
$("#pr_addpic").css("color","green");
$('#image_preview').css("display", "block");
$("#empty").html("");
$("#previewer").append('<div class="col-md-4"><img src="'+e.target.result+'" /></div>');
};
});

$('#pr_addpic').change(function() {
  $('#uploadimage').submit();
});
</script>

<!-- //////////////// END \\\\\\\\\\\\\\\\\  -->


<!-- //////////////// SCRIPTS TEMPLATE OU EXTERNES \\\\\\\\\\\\\\\\\  -->


<script type="text/javascript"> <!-- index.php -->
//<![CDATA[

jQuery(document).ready(function() {
		jQuery('.tp-banner').show().revolution(
	{
		delay:9000,
		startwidth:1170,
		startheight:600,
		navigationType:"bullet",
		navigationStyle:"square",
		hideBulletsOnMobile:"on",
		hideArrowsOnMobile: "on",
		shadow:0,
		fullWidth:"on",
	});
});			

//]]>
</script>

<script type="text/javascript"> <!-- unknown for the now -->
//<![CDATA[

tinymce.init({selector:'#pr_desc'});

//]]>
</script>

	
<script type="text/javascript"> <!-- browse_products.php -->
//<![CDATA[

	$(document).ready(function(){
	var $container = $('.projects');
	$container.imagesLoaded(function() {
	$('.projects').fadeIn(1000).isotope({
	layoutMode : 'fitRows',
    itemSelector : '.element' });
	});
	$('.element').css('opacity',0);
	$('.element').each(function(i){
	$(this).delay(i*150).animate({'opacity':1},350);
	});
});

//]]>
</script>


<script type="text/javascript"> <!-- CROP : sell_yours.php -->
 //<![CDATA[
 
 function readURL(input) {
	if (input.files && input.files[0]) {
		var reader = new FileReader();
		
		reader.onload = function (e) {
			$('#preview_div').attr('class', 'col-md-8');
			$('#upload_pic').html('');
			$('#preview_mainpic').attr('src', e.target.result);
			$('#croptext').html('<h3 style="margin: 0 0 0 0;">Thumbnail</h3><label>You have successfully picked your product\'s main picture. Please drag the image bellow to fit your product in the thumbnail. </label>');
			$('#pic_description').html('');
			
	$( function () {
	$( '#preview_mainpic' ).each( function () {
	var image = $(this),
		cropwidth = image.attr('cropwidth'),
		cropheight = image.attr('cropheight'),
		results = image.next('.results' ),
		x       = $('.cropX', results),
		y       = $('.cropY', results),
		w       = $('.cropW', results),
		h       = $('.cropH', results),
		download = results.next('.download').find('a');
		
		

	  image.cropbox( {width: cropwidth, height: cropheight, showControls: 'auto' } )
		.on('cropbox', function( event, results, img ) {
			$('#x').attr('value', results.cropX);
			$('#y').attr('value', results.cropY);
			$('#w').attr('value', results.cropW);
			$('#h').attr('value', results.cropH);
		  download.attr('href', img.getDataURL());
		});
	});
	});
	}	
		reader.readAsDataURL(input.files[0]);
	}
}
    
$('#pr_mainpic').change(function(){
	readURL(this);
});
          
//]]>
</script>


<!-- DEBUT CAROUSEL -->

<script type="text/javascript">
//<![CDATA[

jQuery(document).ready(function($) {
	$("#slider_home").carouFredSel({ 
		width : "100%", 
		height : "auto",
		responsive : true,
		auto : false,
		items : { width : 280, visible: { min: 1, max: 3 }
		},
		swipe : { onTouch : true, onMouse : true },
		scroll: { items: 1, },
		prev : { button : "#sl-prev", key : "left"},
		next : { button : "#sl-next", key : "right" }
		});
	});
	
//]]>
</script>

<script type="text/javascript">
//<![CDATA[

jQuery(document).ready(function($) {
	$("#slider_related").carouFredSel({ 
		width : "100%", height : "auto",
		responsive : true, auto : false,
		items : { width : 230, visible: { min: 1, max: 5 }
		},
		swipe : { onTouch : true, onMouse : true },
		scroll: { items: 1, },
		prev : { button : "#sl-prev", key : "left"},
		next : { button : "#sl-next", key : "right" }
		});
	});

//]]>
</script> 
		
<script type="text/javascript">
//<![CDATA[

	$(document).ready(function () {
	$('.nivoSlider').nivoSlider({
	 effect: 'fade', manualAdvance: true });
	});
	
//]]>
</script>

<script type="text/javascript"> // Handle the removal of the products in the Cart
//<![CDATA[

$( document ).ready(function() {
	$('#containerWrapper').on('click', '.remove', function (event) {
		var url = $(this).attr('href') ;
		event.preventDefault();
		
		$('#containerWrapper').load(url + " #containerWrapper");
		console.log('Product removed');
	});
});

//]]>
</script>

<script type="text/javascript"> // Handles the modifications about the quantity of products in the Cart
//<![CDATA[

$(document).ready(function()
{
	$("#containerWrapper").on(
	{
		blur: function() 
		{
			//We get the value of the modified input number
			var qty = $(this).val();
			var id = $(this).attr('id');
			var url = "cart.php"

			// Launch of the Ajax request to refresh quantities 
			$('#containerWrapper').load(url + " #containerWrapper", {quantity: qty, pr_id: id, action: "modifQty"});
			
			/* $.ajax({
				url: "cart.php",
				type: "POST",
				data: {quantity: qty, pr_id: id, action: "modifQty"},
				success: function(data)
				{
					$('#containerWrapper').load(url + " #containerWrapper");
					console.log('Quantity updated');
				}
			});  */
		},
		keypress: function(event)
		{
			if(event.which == 13) {
				console.log('You pressed enter!');
				$(this).blur();
			}
		}
	}, 'input');
});

//]]>
</script>

<script type="text/javascript"> // Handles the pagination system
//<![CDATA[

$(document).ready(function(){
    $('#containerWrapper').on('click', '.page', function (event) {
	
        event.preventDefault();
		
        var url = $(this).attr('href');
        var page = $(this).attr('id');
		
        $('#containerWrapper').load(url + " #containerWrapper", {page: page});
    });
});

//]]>
</script>

<script type="text/javascript">
//<![CDATA[
function showSubcat(cat_id)
{
  if (cat_id =="")
    {
     document.getElementById("subcats").innerHTML="";
     return;
    } 
    if (window.XMLHttpRequest)
     {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
     }
  else
    {// code for IE6, IE5
     xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  
  xmlhttp.onreadystatechange=function()
    {
     if (xmlhttp.readyState==4 && xmlhttp.status==200)
      {
        document.getElementById("subcats").innerHTML=xmlhttp.responseText;
      }
    }
    xmlhttp.open("GET","inc/browse.php?cat="+cat_id,true);
    xmlhttp.send();
}
//]]>
</script>

<!-- //////////////// END \\\\\\\\\\\\\\\\\  -->

</body>
</html>
